<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="vue.js"></script>
    <style>
        .active{
            color: red;
        }
    </style>
</head>
<body>
    <div id="app">
        <div :class="[active]" @click="seen">hello world</div>
        <table>
            <tbody>
                <tr is="row"></tr>
                <tr is="row"></tr>
                <tr is="row"></tr>
            </tbody>
        </table>
    </div>
</body>
<script>

    Vue.component('row',{
        data(){
          return {
              content:"this is a row"
          }
        },
        template: '<tr><td>{{content}}</td></tr>'
    })

    var vm = new Vue({
        el:'#app',
        data:{
            isActive:false,
            active:''
        },
        methods:{
            seen:function () {
                //this.active = "active"
                this.active = this.active ==="active" ? "":"active"
            }
        }
    })
</script>
</html>
